import requests from './request'

export const reqCategoryList = () => {
    return requests({
      url: '/api/product/getBaseCategoryList',
      method: 'get'
    })
}

export const reqColumns = () => {
  return requests({
    url: '/api/columns',
    method: 'get'
  })
}

export const reqColumnDetail = (id) => {
  return requests({
    url: `/api/columns/${id}`,
    method: 'get'
  })
}

export const reqLogin = (params) => {
  return requests({
    url: '/api/user/login',
    method: 'post',
    data: params
  })
}

export const reqUserInfo = () => {
    return requests({
      url: '/api/user/current',
      method: 'get',
    })
}

export const reqRegister = (params) => {
  return requests({
    url: '/api/users',
    method: 'post',
    data: params
  })
}

export const reqPost = (data) => {
  return requests({
    url: '/api/posts',
    method: 'post',
    data: data
  })
}
